﻿<UserControl x:Class="BrainTechLLC.FolderExplorer.DirectoriesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:y="clr-namespace:BrainTechLLC.FolderExplorer"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">
    <UserControl.CommandBindings>
        <CommandBinding Command="{x:Static y:DirectoriesView.AddDirCommand}" Executed="AddDir"/>
        <CommandBinding Command="{x:Static y:DirectoriesView.RemoveDirCommand}" Executed="RemoveDir"/>
    </UserControl.CommandBindings>
    <UserControl.InputBindings>
        <KeyBinding Command="{x:Static y:DirectoriesView.RemoveDirCommand}" Key="Delete"/>
    </UserControl.InputBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock x:Name="txtHeader" FontSize="10" Margin="2,0,0,0" FontWeight="Bold" Text="Image Directories:" HorizontalAlignment="Left" VerticalAlignment="Center" />
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <Button FontSize="11" x:Name="btnRemoveDir" 
                    Command="{x:Static y:DirectoriesView.RemoveDirCommand}"  
                    Content="Remove Selected Image Directory" Padding="4,1,4,1" HorizontalAlignment="Right" VerticalAlignment="Center" />
            <Button FontSize="11" x:Name="btnAddDir" 
                    Command="{x:Static y:DirectoriesView.AddDirCommand}"
                    Content="Add New Image Directory" Padding="4,1,4,1" HorizontalAlignment="Right" VerticalAlignment="Center" />
        </StackPanel>
        <ListBox Grid.Row="1" Name="lstItems" ItemsSource="{Binding}"  SelectionMode="Extended" Padding="1,1,1,1" 
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <y:DirectoryView x:Name="dirView" Padding="1,1,1,1" DirectoryToExamineViewModel="{Binding}"  Width="Auto" Height="Auto"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
